package com.jiangyg.mall.db.mybatis;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.jiangyg.mall.core.support.snowflake.SnowflakeBuilder;

/**
 * 类描述：使用雪花算法生成主键ID
 *
 * @author jiangyg
 * @version 4.0
 * @date 2021-10-14
 */
public class SnowflakeIdGenerator implements IdentifierGenerator {

    @Override
    public Number nextId(Object entity) {
        return SnowflakeBuilder.nextId();
    }

}
